Walkthrough 3-4: Add an API to Anypoint Exchange

In this walkthrough, you make an API discoverable by adding it to Anypoint Exchange. You will:

·       Publish an API to Exchange from API Designer.

·       Review an auto-generated API portal in Exchange and test the API.

·       Add information about an API to its API portal.

·       Create and publish a new API version to Exchange.

 

Starting file

If you did not complete the previous walkthrough, you can get a starting file here. This file is also located in the solutions folder of the student files ZIP located in the Course Resources.

Remove the baseUri by turning off the mocking service

1.     Return to API Designer.

2.     Click the slider to turn off the mocking service; the RAML code should no longer have a baseUri.

Publish the API to Anypoint Exchange from API Designer

3.     Click the Publish button.

 

4.     Click the Publish to Exchange button.

5.     In the American Flights dialog box, set the following values:

·       Asset version: 1.0.0

·       API version: v1

6.     Click the More options link.

7.     Look at the ID values.

8.     Click Publish to Exchange.

 

9.     In the American Flights API dialog box, click Done.

Locate your API in Anypoint Exchange

10.  In the main menu, select Exchange; you should see your American Flights API.

 

11.  In the types drop-down menu, select REST APIs; you should still see your API.

 

12.  In the left-side navigation, select Provided by MuleSoft; you should not see your American Flights API in the public Exchange (just the Training: American Flights API).

 

13.  In the left-side navigation, select the name of your organization (Training in the screenshots); you should see your American Flights API in your private Exchange.

 

Review the auto-generated API portal

14.  Click the American Flights API.

15.  Review the page; you should see that as the creator of this API, you can edit, review, share, download, and add tags to this version.

  

16.  Locate the API version (v1) and minor version (1.0.x) next to the name of the API at the top of the page.

 

17.  Locate the asset versions for 1.0.x; you should see one version (1.0.0) of this API specification (v1) has been published for this minor version and there is one API instance for it and that uses the mocking service. 

 

18.  In the left-side navigation, select API instances; you should see information for the API instance generated from the API specification using the mocking service.

 

19.  In the left-side navigation, expand Types.

20.  Select AmericanFlight and review the information.

 

Test the API in its API portal in Exchange

21.  In the left-side navigation, select the /flights GET method; you should now see the API console on the right side of the page.

22.  In the API console, select to show optional query parameters.

23.  Click the destination drop-down and select a value.

 

24.  Click Send; you should get a 200 response and the example data displayed – just as you did in API console in API Designer.

 

Add information about the API

25.  In the left-side navigation, select Home.

26.  Click the Edit button for the API near the center.

 

27.  Return to the course snippets.txt file and copy the text for the American Flights API description text.

28.  Return to the editor in Anypoint Exchange and paste the content.

29.  Select the words american table and click the strong button (the B).

 

30.  Select the words training database and click the emphasis button (the I).

 

31.  Select the words Supported operations and select Heading 4 from the heading drop-down menu (the H).

 

32.  Select Get all flights and click the bulleted list button.

33.  Repeat for the other operations.

 

34.  Select the Visual tab in the editor toolbar and view the rendered markdown.

 

 

35.  Click the Save as draft button; you should now see buttons to discard the draft, exit the draft, or publish it.

36.  Click the Publish button; you should now see the new information about the API in the API portal.

Modify the API and publish the new version to Exchange

37.  Return to your American Flights API in API Designer.

38.  Return to the course snippets.txt file and copy the American Flights API - /{ID} DELETE method.

39.  Return to american-flights-api.raml and paste the code after the {ID}/get method.

40.  Fix the indentation if necessary.

41.  Review the code.

 

42.  Click the Publish button.

43.  Click the Publish to Exchange button.

44.  In the American Flights API dialog box, look at the asset version.

 

45.  Click Publish to Exchange.

46.  In the American Flights API dialog box, click Exchange; Exchange should open in a new browser tab.

47.  Locate the asset versions listed for the API; you should see both asset versions of the API listed with an associated API instance using the mocking service for the latest version.

  

48.  Click the Edit button for the API near the upper-right corner.

  

49.  Add the new delete a flight operation.

 

50.  Click Save as draft and then Publish.

  



Did you complete the walkthrough?

  Yes, I completed the walkthrough

  No, I did not complete the walkthrough

  I completed part of the walkthrough


Comments and/or feedback